<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"> 

<h:head>
<f:metadata>
	<f:viewParam name="matricula" value="#{cadFuncionario.funcionario}" />
	<h1>CADASTRO DE FUNCIONARIO</h1>	
</f:metadata>      
</h:head> 
<h:body> 
	<h1>CADASTRO DE FUNCIONARIO</h1>
	<h:form id="cadastro">
		<h:panelGrid border="1" columns="3">
		<h:outputLabel value="Matricula:" for="matricula"/>
		<h:inputText id="matFuncionario" size="20" value="#{cadFuncionario.funcionario.matricula}" required="true" requiredMessage="Obrigatório"></h:inputText>
		<h:message for="matFuncionario" style="color=red" />
		
		<h:outputLabel value="Cargo:" for="cargo"/>
		<h:inputText id="cargoFuncionario" size="30" value="#{cadFuncionario.funcionario.cargo}" required="true" requiredMessage="Obrigatório"></h:inputText>
		<h:message for="cargoFuncionario" style="color=red" />		
		</h:panelGrid>		
		<br />
		<h:commandButton id="gravar" value="Salvar"	actionListener="#{cadFuncionario.gravarAction()}" style="width: 80px;">
		<f:ajax execute="@form" render="@form"></f:ajax>
		</h:commandButton>
		<h:commandButton id="voltar" value="Voltar" action="/index" immediate="true" style="width: 80px;"></h:commandButton>	
	
	</h:form>
		
</h:body> 
</html>
